// index.js
import React from "react";
import { createRoot } from "react-dom/client";
import { StrictMode } from "react";
import { BrowserRouter } from "react-router-dom"; // 导入 BrowserRouter
import { Provider } from "react-redux"; // 导入 Provider
import { store } from "./slices/store.js"; // 导入 store
import "./index.css";
import App from "./App.jsx"; // 确保路径正确
import { ConfigProvider } from "antd";
import zh_CN from "antd/es/locale/zh_CN"; // 正确引入中文配置

// 创建根
const root = createRoot(document.getElementById("root"));

// 渲染应用
root.render(
  <StrictMode>
    <BrowserRouter>
      {" "}
      {/* 包裹 App 组件 */}
      <Provider store={store}>
        {" "}
        {/* 使用 Provider 包裹 App 组件 */}
        <ConfigProvider locale={zh_CN}>
          {" "}
          {/* 正确传递 locale */}
          <App />
        </ConfigProvider>
      </Provider>
    </BrowserRouter>
  </StrictMode>
);
